﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using r4u.business.logic.layer.ASSESS;

namespace r4u.Controllers
{
    public class CompareController : Controller
    {
        [HttpPost]
        public ActionResult Do(CompareObj obj)
        {
            DoCompare compare = new DoCompare();

            var settings = new JsonSerializerSettings
          {
              ContractResolver = new CamelCasePropertyNamesContractResolver()
          };

            var jsonResult = new ContentResult
           {
               Content = JsonConvert.SerializeObject(compare.Do(obj.vacancy_id, obj.applicant1, obj.applicant2), settings),
               ContentType = "application/json"
           };
            return jsonResult;
        }

    }
}
